﻿@using Emoney.UserTraining.Model;
@using ST = Emoney.UserTraining.Comm.StringTools;
@{
    Layout = null;
    var lst = ViewData["lst"] as List<Traning_NetworkMeeting>;
    string sortName = (string)ViewData["sortName"];
    string sortFlag = (string)ViewData["SortFlag"];
    int pageindex = Convert.ToInt32(ViewData["PageIndex"]);
}
<script type="text/javascript">

    //推荐和取消
    function recommendNetworkMeeting(t, id) {
        var msg = "确定要取消推荐么？";
        if (t == "1") {
            msg = "确定要推荐么？";
        }
        if (confirm(msg)) {
            $.ajax({
                type: "POST",
                async: false,
                url: "../aspx/ajaxNetworkMeeting.ashx",
                data: { action: "VideoRecommend", id: id, t: t },
                success: function (msg) {
                    alert(msg);
                    Query();
                },
                beforeSend: function () {
                },
                complete: function () {
                    //$("#loadingImg").remove();
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    //alert(XMLHttpRequest.status);
                }
            });
        }
    }

    //删除会议
    function deleteNetworkMeeting(id) {
        if (confirm("确定要删除该会议么？")) {
            $.ajax({
                type: "POST",
                async: false,
                url: "../aspx/ajaxNetworkMeeting.ashx",
                data: { action: "DeleteNetworkMeeting", id: id },
                success: function (msg) {
                    alert(msg);
                    Query();
                },
                beforeSend: function () {
                },
                complete: function () {
                    //$("#loadingImg").remove();
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    //alert(XMLHttpRequest.status);
                }
            });
        }
    }

</script>
<table cellspacing="0" cellpadding="3" rules="all" border="1" id="GridView1" style="background-color: White; border-color: #CCCCCC; width: 99%; border-collapse: collapse;">
    <tr style="background-color: #E3EFFB;">
        <th scope="col">ID
        </th>
        <th scope="col">会议编号
        </th>
        <th scope="col">名称
        </th>
        <th scope="col">讲师
        </th>
        <th scope="col">开课时间
        </th>
        <th scope="col">视频地址
        </th>
        <th scope="col">发布版本
        </th>
        <th scope="col">操作
        </th>
    </tr>
    <tbody>
        @if (lst == null || lst.Count <= 0)
        {
            <tr>
                <td colspan="20" align="center">暂无数据
                </td>
            </tr>
        }
        @for (int i = 0; i < lst.Count; i++)
        {
            var c = lst[i];
            <tr style="color: #000066;">
                <td>
                    @c.Id
                </td>
                <td>
                    @c.mtg_id
                </td>
                <td>
                    <a href="javascript:void(0)" style="color: #1a438e; cursor: default" title="@c.mtg_conent">
                        @ST.GetHtmlString(c.mtg_name_dis)</a>
                </td>
                <td>
                    <a href="javascript:void(0)" style="color: #1a438e; cursor: default" title="@c.txtreateachar">
                        @ST.GetHtmlString(c.txtteachar)</a>
                </td>
                <td>
                    @c.class_date.ToString("yyyy-MM-dd HH:mm:ss")
                </td>
                <td>
                    @if (!string.IsNullOrEmpty(c.video_url))
                    {
                        <a href="@c.video_url" target="_blank">查看视频</a>
                    }
                </td>
                <td>
                    @c.chblist_pro_dis
                </td>
                <td>
                    @if (c.video_Recommend == "1")
                    {
                        <a href="#" onclick="recommendNetworkMeeting('0',@c.Id);">取消推荐</a>
                    }
                    else
                    {
                        <a href="#" onclick="recommendNetworkMeeting('1',@c.Id);">视频推荐</a>
                    }
                    @if (!string.IsNullOrEmpty(c.video_url))
                    {
                        <a href="~/Temporary/Edit?id=@c.Id">修改视频</a>
                    }
                    else
                    {
                        <a href="~/Temporary/Edit?id=@c.Id">添加视频</a>
                    }
                    <a href="~/aspx/NetworkMeetingAdd.aspx?id=@c.Id&type=history">修改</a>
                    <a href="#" onclick="deleteNetworkMeeting(@c.Id);">删除</a>
                </td>
            </tr>
        }
    </tbody>
</table>
@Html.Raw((string)ViewData["strPage"])